<template>
  <div>
    <div class="kongbai"></div>
    <school-title Cname="网校课程"></school-title>
    <div class="list-course">
      <div v-for="item in list" :key="item.id">
        <img :src="'https://ss.lanqb.com/' + item.posters.mobile" alt="" />
        <p>{{ item.title }}</p>
      </div>
    </div>
  </div>
</template>

<script>
import SchoolTitle from "@/components/schoolTitle.vue";
export default {
  name: "SchoolOne",

  data() {
    return {
      list: [], // 页面共用的左右两个标签
    };
  },
  components: {
    SchoolTitle,
  },

  created() {
    fetch("https://m.lanqb.com/api/school/professionals?limit=4")
      .then((res) => res.json())
      .then((data) => {
        // console.log(data);
        this.list = data.data;
        console.log(this.list);
      });
  },

  methods: {},
};
</script>

<style lang="scss" scoped>
* {
  margin: 0;
  padding: 0;
}
.kongbai {
  width: 100%;
  height: 15px;
  background-color: #eee;
}
.list-course {
  padding: 0 5px;
  width: 97%;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  // padding: 0 11px;
  // box-sizing: border-box;
  margin-top: 15px;
  div {
    width: 188px;
    // margin-right: 14px;
    img {
      width: 188px;
      height: 104px;
      border-radius: 5px;
    }
    p {
      color: #222;
      text-align: left;
      height: 36px;
      font-size: 14px;
    }
  }
}
</style>
